//
// Created by jsjxsy on 2022/8/22.
//
#include <string>
#include <iostream>
#include <sstream>
#include <vector>
using namespace std;
struct PersonInfo {
  string name;
  vector<string> phones;
};
bool valid(const string &basic_string);
string format(const string &basic_string);
int main() {
  // will hold a line and word from input, respectively
  string line, word;
  // will hold all the records from the input
  vector<PersonInfo> people;
  // read the input a line at a time until end-of-file (or other error)
  while (getline(cin, line)) {
    PersonInfo info;
    // object to hold this record's data
    istringstream record(line);
    // bind record to the line we just read
    record >> info.name;
    // read the name
    while (record >> word) {
      // read the phone numbers
      info.phones.push_back(word);
    }
    // and store them
    people.push_back(info);
    // append this record to people
  }
  // for each entry in people
  for (vector<PersonInfo>::const_iterator entry = people.begin(); entry != people.end(); ++entry) {
    ostringstream formatted, badNums;
    // objects created on each loop
    // for each number
    for (vector<string>::const_iterator nums = entry->phones.begin(); nums != entry->phones.end(); ++nums) {
      if (!valid(*nums)) {
        badNums << " " << *nums;
        // string in badNums
      } else
        // ``writes'' to formatted's string
        formatted << " " << format(*nums);
    }
    if (badNums.str().empty())
      // there were no bad numbers
      cout << entry->name << " " // print thename
           << formatted.str() << endl; // and reformatted numbers
    else // otherwise, print the name and bad numbers
      cerr << "input error: " << entry->name << " invalid number(s) " << badNums.str() << endl;
  }
  return 0;
}
bool valid(const string &basic_string) {
  return false;
}
string format(const string &basic_string) {
  return "";
}
